<html>
<head>
	<meta  http-equiv="Content-type" content="text/html; utf-8" />
	<title>Test ciasteczek</title>
	<script type="text/javascript" src="../XMLHttpCookieRequest.js"></script>
	<script type="text/javascript">
	function testXml()
	{
		var client = new XMLHttpCookieRequest();
		client.open('GET', 'xml.php');
		client.setRequestHeader('Content-type', 'text/xml');
		client.onreadystatechange = function()
		{
			if (200 === this.status && 4 === this.readyState)
			{
				var xml = this.responseXml;
				var info = xml.getElementsByTagName('imie')[0].firstChild.nodeValue + ' ' +
						xml.getElementsByTagName('nazwisko')[0].firstChild.nodeValue;
				alert(info);
			}
		}
		client.send('imie=Patryk&nazwisko=Jar');
	}

	function testTxt()
	{
		var client = new XMLHttpCookieRequest();
		client.open('GET', 'text.php');
		client.onreadystatechange = function()
		{
			if (200 === this.status && 4 === this.readyState)
			{
				alert(this.responseText);
			}
		}
		client.send('imie=Patryk&nazwisko=Jar');
	}
	</script>
</head>
<body>
	<a href='javascript:testTxt()'>Test responseText</a><br />
	<a href='javascript:testXml()'>Test responseXml</a>
	
	<p><strong>Kod:</strong></p>
	<pre>
	&lt;script type="text/javascript"&gt;
	function testXml()
	{
		var client = new XMLHttpCookieRequest();
		client.open('GET', 'xml.php');
		client.setRequestHeader('Content-type', 'text/xml');
		client.onreadystatechange = function()
		{
			if (200 === this.status && 4 === this.readyState)
			{
				var xml = this.responseXml;
				var info = xml.getElementsByTagName('imie')[0].firstChild.nodeValue + ' '
						xml.getElementsByTagName('nazwisko')[0].firstChild.nodeValue;
				alert(info);
			}
		}
		client.send('imie=Patryk&nazwisko=Jar');
	}

	function testTxt()
	{
		var client = new XMLHttpCookieRequest();
		client.open('GET', 'text.php');
		client.onreadystatechange = function()
		{
			if (200 === this.status && 4 === this.readyState)
			{
				alert(this.responseText);
			}
		}
		client.send('imie=Patryk&nazwisko=Jar');
	}
	&lt;/script&gt;
	</pre>
</body>
</html>
